package com.xiaobai.Result;

import lombok.Data;

/**
 * @Author
 * @Description
 * @Date created in 11:31 2025/2/6
 */
@Data
public class R {
    private Integer code;
    private String msg;
    private String data;
    public static R ok(){
        R r = new R();
        r.setCode(200);
        r.setMsg("操作成功");
        return r;
    }

    public static R ok(Integer code,String msg){
        R r = new R();
        r.setCode(code);
        r.setMsg(msg);
        return r;
    }

    public static R error(Integer code,String msg){
        R r = new R();
        r.setCode(code);
        r.setMsg(msg);
        return r;
    }
    public static R error(){
        R r = new R();
        r.setCode(500);
        r.setMsg("操作失败");
        return r;
    }
}
